package at.fhv.components.sobel;

import java.beans.BeanDescriptor;
import java.beans.EventSetDescriptor;
import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import java.lang.reflect.Method;

import at.fhv.framework.events.ImageEvent;
import at.fhv.framework.listeners.ImageProcessingListener;

/**
 * The ImagePanelBeanInfo class.
 * 
 * @author Michael Sieber
 */
public class SobelFilterBeanInfo extends SimpleBeanInfo {
	@Override
	public EventSetDescriptor[] getEventSetDescriptors() {
		try {
			// bean name
			Class<?> localClass1 = SobelFilter.class;
			String str1 = "SobelFilter";

			// method names
			Class<?> localClass2 = ImageProcessingListener.class;
			String[] arrayOfString = { "imageChanged" };
			String str2 = "addImageChangeListener";
			String str3 = "removeImageChangeListener";

			// add method names
			EventSetDescriptor localEventSetDescriptor =
					new EventSetDescriptor(localClass1, str1, localClass2,
							arrayOfString, str2, str3);
			EventSetDescriptor[] arrayOfEventSetDescriptor =
					{ localEventSetDescriptor };
			return arrayOfEventSetDescriptor;
		} catch (Exception localException) {
			localException.printStackTrace();
		}
		return null;
	}

	@Override
	public MethodDescriptor[] getMethodDescriptors() {
		try {
			Class<?> localClass = SobelFilter.class;
			Class<?>[] arrayOfClass = new Class[1];
			arrayOfClass[0] = ImageEvent.class;
			String str = "imageChanged";
			Method localMethod = localClass.getMethod(str, arrayOfClass);
			ParameterDescriptor[] arrayOfParameterDescriptor =
					new ParameterDescriptor[1];
			arrayOfParameterDescriptor[0] = new ParameterDescriptor();
			MethodDescriptor localMethodDescriptor =
					new MethodDescriptor(localMethod,
							arrayOfParameterDescriptor);
			MethodDescriptor[] arrayOfMethodDescriptor =
					{ localMethodDescriptor };
			return arrayOfMethodDescriptor;
		} catch (Exception localException) {
			localException.printStackTrace();
		}
		return null;
	}

	@Override
	public PropertyDescriptor[] getPropertyDescriptors() {
		try {
			PropertyDescriptor[] arrayOfPropertyDescriptor =
					new PropertyDescriptor[0];
			return arrayOfPropertyDescriptor;
		} catch (Exception localException) {
			localException.printStackTrace();
		}
		return null;
	}

	@Override
	public BeanDescriptor getBeanDescriptor() {
		return new BeanDescriptor(SobelFilter.class, SobelCustomizer.class);
	}
}
